package br.com.forca.utils;

import java.util.List;

import br.com.forca.model.jogador.Playable;

public class PlayerUtils {
	
	//private PlayerFactory factory;
	//private List<Playable> playersList;
	
	public PlayerUtils() {
		//this.factory = new PlayerFactory();
		//this.playersList = factory.createJogadores();
	}
	
	public String retornaNomes (List<Playable> lista){
		String retorno="";
		int x;
		for (x = 0; x < lista.size(); x++ ){
			retorno += lista.get(x).getNome()+ ", ";
		}
		
		if(x==1){
		return retorno.replace(", ", " ");
		}
		
		return retorno;
	}
	
	public List<Playable> zeraErros(List<Playable>lista){
		for(int x=0; x<lista.size(); x++ ){
			lista.get(x).setNumeroDeErros(0);
		}
		
		return lista;
	}

}
